import {buildAbsAdminEcharts} from "@/assets/echarts/js/absEcharts.js";
import {absAdminPie_option} from "@/assets/echarts/option/absEcharts.js";
import {buildCaAdminEcharts} from "@/assets/echarts/js/caEcharts.js";

export let caAdminPie_option = {
    title: {
        text: '竞赛认定结果',
        left: 'center'
    },
    tooltip: {
        trigger: 'item'
    },
    legend: {
        orient: 'vertical',
        left: 'left'
    },
    series: [
        {
            type: 'pie',
            radius: '50%',
            labelLine: {
                show: false
            },
            label: {
                show: false,
            },
            data: [
                { value: 0, name: '国家级' },
                { value: 0, name: '省部级' },
                { value: 0, name: '校级' },
            ],
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

await buildCaAdminEcharts().then(data => {
    if(data) {
        caAdminPie_option.series[0].data[0].value = data.national
        caAdminPie_option.series[0].data[1].value = data.provincial
        caAdminPie_option.series[0].data[2].value = data.school
    }
})